跳到主要内容

AVERAGE

Returns the average (arithmetic mean) of the specified arguments.

Syntax

expression.AVERAGE(args);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
argsRequiredApiRangeApiNamenumber

Returns

number

Example

var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
var ans = oFunction.AVERAGE(123, 197, 46, 345, 67, 456);
oWorksheet.GetRange("B2").SetValue(ans);